package com.sun.stockexchangesimulate.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 股票订单表
 * @author sun
 * @TableName stock_order
 */
@TableName(value ="stock_order")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StockOrder implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 投资者id
     */
    private Integer investorId;

    /**
     * 股票代码
     */
    private String stockCode;

    /**
     * 股票数量
     */
    private Integer quantity;

    /**
     * 股票买入或卖出价格
     */
    private BigDecimal price;

    /**
     * 买入或卖出  0 买入  1 卖出
     */
    private String type;

    /**
     * 订单创建时间
     */
    private LocalDateTime createDate;

    /**
     * 订单状态 0 未成交，1 已成交 2 部分成交 3 已取消
     */
    private String status;

    /**
     * 剩余未成交数量
     */
    private Integer remainingQuantity;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}